function trim(value) {
return value.replace(/^\s+|\s+$/,'');
}

